import {view, View, binder} from "adajs";
import AccordionService from "./state.js";

@view({
    className: "accordion-contact",
    template: "./template.html",
    style: "./style.scss",
    dataset: {
        service: AccordionService
    }
})
class Accordion extends View {
    onready() {
        this.commit("update");
    }

    @binder("toggle")
    toggle({sort}) {
        this.commit("toggle", sort);
    }

    @binder("search")
    search() {
        this.commit("search", this.finder("keyword").getElement().value);
    }
}

export default Accordion;